import {Menu, MenuProps} from "antd";
import {useState} from "react";
import styles from './index.less'

type MenuItem = Required<MenuProps>['items'][number];

export default ({menus=[]}:{menus:MenuItem[]})=>{
  const [current, setCurrent] = useState('mail');

  const onClick: MenuProps['onClick'] = (e) => {
    console.log('click ', e);
    setCurrent(e.key);
  };

  return (<Menu className={styles.menus} style={{background:'transparent',width:'calc(100vw - 300px)'}} onClick={onClick} selectedKeys={[current]} mode="horizontal" items={menus} />)
}
